



nums1 = [1,3], nums2 = [2,4]



var findMedianSortedArrays = function(nums1, nums2) {
              
    let nums=[...nums1,...nums2]
    nums.sort((a,b)=>(a-b))
    const len=nums.length
    if(len%2===0)
    {
        return(nums[len/2-1]+nums[len/2])/2
    }
    else
    {
        return nums[Math.floor(len/2)]
    }

    
};
console.log(findMedianSortedArrays(nums1,nums2));
